﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
using KPIS.GERP.Models.HRM;

namespace KPIS.GERP.Models.SYS
{
    [DataContract, Table("SysPositionRole")]
    public class PositionRole
    {
        [Key]
        [DataMember]
        public int PositionRoleId { get; set; }

        [ForeignKey("Position")]
        [DataMember, Display(Name = "PosId", ResourceType = typeof(Resources.PositionRoleResource))]
        public int? PosId { get; set; }

        [DataMember]
        public virtual Position Position { get; set; }

        [DataMember]
        public virtual ICollection<Role> Roles { get; set; }


        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public int? CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public DateTime? CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public int? UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public DateTime? UpdatedWhen { get; set; }

        #endregion

    }
}